package view;

import javax.swing.JFrame;

import model.LoginDetails;
import model.UserSession;

public class ClientFrame extends JFrame {

	private UserSession userSession;

	public ClientFrame() {
		this.setBounds(200, 200, 820, 550);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		this.setTitle("Client");
		this.setResizable(false);
		this.setVisible(true);
		new LoginPanel(this);

	}

	public static String getPasswordString(char[] c) {
		String password = "";
		for (int i = 0; i < c.length; i++) {
			password += c[i];
		}
		return password;
	}

	public void goToActivatePanel(LoginDetails loginDetails) {
		new ActivatePanel(this, loginDetails);
	}

	public void goToLiveFeedPanel() {
		new LiveFeedPanel(this);
	}

	public void goToLoginPanel() {
		new LoginPanel(this);
	}

	public void goToRegisterPanel() {
		new RegisterPanel(this);
	}

	public void goToViewResultsPanel() {
		new ViewResultsPanel(this);
	}

	public void goToDiplayMessagePanel(String message) {
		new DiplayMessagePanel(this, message);
	}

	public void goToVotePanel() {
		new VotePanel(this);
	}


	public void goToAdminPanel() {
		new AdminPanel(this);
	}

	public static void main(String[] args) {
		new ClientFrame();
	}

	
	public void setUserSession(UserSession userSession) {
		this.userSession = userSession;
	}

	public UserSession getUserSession() {
		return userSession;
	}

}
